package com.wsz.staservice.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wsz.commonutils.R;
import com.wsz.staservice.client.UcenterClient;
import com.wsz.staservice.pojo.StatisticsDaily;
import com.wsz.staservice.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/staservice/sta")
public class StatisticsDailyController {

    @Autowired
    private StatisticsDailyService service;

    @PostMapping ("/registerCount/{day}")
    public R registerCount(@PathVariable String day){
        service.registerCount(day);
        return R.ok();
    }

    @GetMapping("/showData/{type}/{begin}/{end}")
    public R showData(@PathVariable String type,
                      @PathVariable String begin,
                      @PathVariable String end) {

        Map<String,Object> map = service.getShowData(type,begin,end);
        return R.ok().data(map);
    }
}
